Caption = "Click a button below for information about these objects and how they contrinute to the VBFrameWork:"
Height = 255
Index = 2
Left = 120
TabIndex = 11
Top = 1440
Width = 7575
End
Begin VB.Label Label2
Caption = $"DemoIntr.frx":0000
Height = 495
Index = 1
Left = 120
TabIndex = 10
Top = 840
Width = 8535
End
Begin VB.Label Label2
Caption = $"DemoIntr.frx":00E1
Height = 495
Index = 0
Left = 120
TabIndex = 9
Top = 4320
Width = 8535
End
Begin VB.Label Label1
Caption = $"DemoIntr.frx":017A
Height = 615
Left = 120
TabIndex = 8
Top = 120
Width = 8415
End
End
Attribute VB_Name = "Intro"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Public ObjectManager As VBOFObjectManager
Private tempString As String
Private Sub Form_Load()
Dim tempString As String
tempString = "(c) 1996 Ken Fitzpatrick"
tempString = tempString & vbCrLf & _
"The VB Object Framework and this demonstration package are provided on an as-is, use-at-your-own-risk basis."
tempString = tempString & vbCrLf & _
vbCrLf & _
"Even though thorough testing has been performed on this product and demonstration package and every resonable precaution has been taken, the author assumes no responsibilities of any actions or damages which result from the use of this product or demonstration package."
tempString = tempString & vbCrLf & _
vbCrLf & _
"The above statement is necessary because the very nature of VB Object Framework is to manipulate data in the form of objects. Under certain circumstances, particularly under situations of misuse or where the user is unfamiliar the product, it would be possible to damage or destroy data. The author cannot, and will not, be responsible for such use of this product or demonstration package."
lblDescription = tempString
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
ObjectManager.Form_QueryUnload _
Me
#If NoEventMgr = False Then
ObjectManager. _
UnRegisterForAllEvents _
RegisterObject:=Me
#End If
End Sub
Private Sub Command1_Click()
Dim tempString As String
Me.MousePointer = vbArrowHourglass
tempString = "Creating test data now . . ."
tempString = tempString & vbCrLf & _
vbCrLf & _
"Puzzle: " & vbCrLf & _
"- Why does Martha Washington's Person information display only in demonstration sessions where the 'Create Demo Objects' button has been clicked earlier in that session (versus running the demonstration and going directly to one of the display-oriented windows)?" & vbCrLf & _
"- How does this impact the ability to display personal information about Goerge Washington? "
tempString = tempString & vbCrLf & _
vbCrLf & _
"Hint words: " & vbCrLf & _
"Object persistence, Person object 'Martha'"
lblDescription = tempString
DoEvents
BOMTestScript
Me.MousePointer = vbArrow
Command7.SetFocus
End Sub
Private Sub Command2_Click()
Me.MousePointer = vbArrowHourglass
publicCompany.Persons.Refresh
' pass-along the ObjectManager
Set CustomerDetailsDataControl.ObjectManager = _
ObjectManager
Set EventMessages.ObjectManager = _
ObjectManager
#If NoEventMgr = False Then
EventMessages.Show
#End If
CustomerDetailsDataControl.Show
Me.MousePointer = vbArrow
End Sub
Private Sub Command3_Click()
Me.MousePointer = vbArrowHourglass
tempString = "(c) 1996 Ken Fitzpatrick"
tempString = tempString & vbCrLf & _
"Removing all Collections and Objects . . ."
lblDescription = tempString
DoEvents
ObjectManager.CompleteObjectCleanUp
Me.MousePointer = vbArrow
End
End Sub
Private Sub Command4_Click()
Dim tempString As String
tempString = "(c) 1996 Ken Fitzpatrick"
tempString = tempString & vbCrLf & _
"The VBOFObjectManager functions as a governing entity, overseeing all object-oriented implementations of the VBOF. "
tempString = tempString & vbCrLf & _
vbCrLf & _
"VBOFObjectManager has the following characteristics:" & vbCrLf & _
" - it works in conjunction with the VBOFEventManager to deliver event notifications to registered objects;" & vbCrLf & _
" - it works in conjunction with the application to instantiate new contained objects (e.g., Person.Mother, Employee.Manager, etc.) and new VBOFCollections (e.g., Person.Addresses, Order.Items, etc.) from a Database Table or a RecordSet object;" & vbCrLf & _
" - it ensures that no given object is ever instantiated more than once, thus avoiding those ideosynchracies which arise when multiple instances of a given object are found to exist."
tempString = tempString & vbCrLf & _
vbCrLf & _
"To evalute the impact of VBOFObjectManager, please refer to the 'BOMTestScript' method of the 'DemoVBObjectFramework' (DemoVBFW.BAS) file. " & _
"Another means is to open the two demo windows via the 'Pure OO Demo (DBGrid)' and 'Pure OO Demo (ListBox)' buttons. From either window, change any item and click the 'Update' button, then observe the same object on the other window. " & _
"Since both windows reference the identical objects, the change is reflected in both places simultaneously. For additional information about reflecting dynamically changing object properties across the application, please refer to the description of the VBOFEventManager." & _
vbCrLf & vbCrLf & _
"Also, notice that these windows display 'rich' information in the lower viewing pane as the mouse passes over the person's name and address areas. This information is considered 'rich' because, for example, the person object knows who its Spouse, Mother or Father are; addresses know the Capitay City of its state. " & _
"These items are not typically available in 'non-rich' environments, because, quite simply, only object-oriented techniques bring this type of power to the application developer. The VBOFObjectManager supports the enriched environment by supporting contained (i.e., 'imbedded') objects."
tempString = tempString & vbCrLf & _
vbCrLf & _
"To create an instance of VBOFObjectManager, please refer to the 'PopulateObjectManager' method of the 'TestVBOFObjectManager' (DemoVBFW.BAS) file or the VBOF User's Guide."
tempString = tempString & vbCrLf & _
vbCrLf & _
"VBOFObjectManager supports a dynamic 'DebugMode', where all of the important decisions and operations by VBOF are logged to the VB Immediate Window. After thoroughly testing an application, the execution speed of the application code can be enhanced slightly by disabling the code which dynamically checks for 'DebugMode' being in effect simply by specifying the conditional compilation string: 'NoDebugMode = -1' (without the apostrophes.)"
lblDescription = tempString
End Sub
Private Sub Command5_Click()
Dim tempString As String
tempString = "(c) 1996 Ken Fitzpatrick"
tempString = tempString & vbCrLf & _
"The VBOFEventManager implements a system-wide event-management scheme, where any object can trigger events and any other object can be notified of the event."
tempString = tempString & vbCrLf & _
vbCrLf & _
"This can be very useful for performing automatic 'backgound' functions without having to include the notification mechanisms within the generating application."
tempString = tempString & vbCrLf & _
vbCrLf & _
"For example, upon changing a customer's DateOfBirth, it might be necessary to recompute any applicable life insurance premiums, or upon learning of the birth of a child, " & _
"it might be company policy to mail a note of congratulations. The optimum means of supporting these functions is to have them processed automatically and " & _
"independently of the original application, via an event management system. " & _
"To support these objectives in the most concise and maintainable manner, the original application should simply trigger events for which the peripheral applications can register and process accordingly. This also alleviates the need for the original application to absorb the responsibility of specifically notifying each of the interested tasks of any such changes."
tempString = tempString & vbCrLf & _
vbCrLf & _
"But perhaps the most useful purpose for the VBOFEventManager is to facilitate the separation of responsibilities between the GUI and the BOM. " & _
"Such a separation facilitates the design and implementation of a non-visual BOM, and the eventual addition of the GUI. " & _
"The BOM objects can then trigger events which are processed by the GUI and vice versa. Under this object-oriented scheme, any necessary processing is conducted by the BOM, then the GUI merely presents the processed data on the screen."
tempString = tempString & vbCrLf & _
vbCrLf & _
"VBOFEventManager performs the following:" & vbCrLf & _
" - sends event notifications to registered objects."
tempString = tempString & vbCrLf & _
vbCrLf & _
"Events can be triggered by any object, not just these 'VBOF' objects." & vbCrLf
tempString = tempString & vbCrLf & _
"Events can be named anything, such as 'Changed', 'Added', 'Deleted', 'Disqualified', etc." & vbCrLf
tempString = tempString & vbCrLf & _
"Event Notification occurs for any object which has registered for the current event (by 'EventType:='), the current object type (by 'ObjectType:=') or for a specific object instance (by 'ObjectID:=') as determined by its ObjectID property."
tempString = tempString & vbCrLf & _
vbCrLf & _
"Event Notification can be completely disabled and the associated .CLS files safely removed from a VB Project simply by specifying the conditional compilation string: 'NoEventMgr = -1' (without the apostrophes.)"
tempString = tempString & vbCrLf & _
vbCrLf & _
"For the coolest example of the VBOFEventManager's capabilities, try the following:" & vbCrLf & _
" - Start both of the 'Pure OO' demos by clicking the 'Pure OO Demo (DBGrid)' button and the 'Pure OO Demo (ListBox)' button, below;" & vbCrLf & _
" - Arrange both windows to be able to observe them both simultaneously;" & vbCrLf & _
" - Select the corresponding object in both windows (e.g., click on 'Bill Clinton' in the list-area of both of the windows);" & vbCrLf & _
" - Change a given attribute of that object (e.g., change Bill's First Name field to 'First Dude'), then click the 'Update' button;" & vbCrLf & _
" - Watch in amazement as the other window instantly reflects the corresponding change."
tempString = tempString & vbCrLf & _
"This represents the type of interaction that Event Management can facilitate between the non-visual BOM and the GUI as the GUI is being developed 'over' the BOM."
tempString = tempString & vbCrLf & _
vbCrLf & _
"For other examples of the VBOFEventManager's capabilities, try the following (followed by clicking the respective 'Update' button), then watch the 'Event Messages' window for the results:" & vbCrLf & _
" - Adjust the Customer's Date of Birth (by a decade, or so). This triggers a simulated product cross-selling facility to meet the changing needs of the customer throughout his life. Running as a separate 'background' task, the product cross-selling facility does not have to impose its specific requirements upon the customer maintenance program, which keeps both programs 'clean' and highly maintainable;" & vbCrLf & _
" - Adjust the Address, but don't use 'Suite' in any of the 'Lines'. This triggers a simulated address validation which asks the user to ensure that the missing 'Suite' value in the updated address is correct;" & vbCrLf & _
" - Adjust the Phone Number to something very short or very long. This triggers a simulated phone number validation which asks the user if the unusual length of the phone number is correct."
lblDescription = tempString
End Sub
Private Sub Command6_Click()
Dim tempString As String
tempString = "(c) 1996 Ken Fitzpatrick"
tempString = tempString & vbCrLf & _
"The VBOFCollection is a direct replacement for the VB4 Collection object, including '.Add'. '.Item' and '.Remove' methods, but adds several database-related capabilities, such as:" & vbCrLf & _
" - automatically interacting with other instances of VBOFCollection through the VBOFEventManager to synchronize knowledge of changes to common objects across multiple collections."
tempString = tempString & vbCrLf & _
vbCrLf & _
"Of course, VBOFCollection provides numerous methods which further support the application to this end."
tempString = tempString & vbCrLf & _
vbCrLf & _
"VBOFCollection can also be used to populate and assist in the processing of Grids, DBGrids, ListBoxes, ComboBoxes, etc. from collections of instantiated objects. " & _
"This facilitates a stronger object-oriented implementation of those GUI controls because when the user selects a given item from one of these, VBOFCollection returns to the application the associated object, not just a character string or a ListIndex value. " & _
"This allows the GUI to continue functioning in a conventional, procedural-oriented manner while the application and its BOM can function in an object-oriented manner."
lblDescription = tempString
End Sub
Private Sub Command7_Click()
Me.MousePointer = vbArrowHourglass
publicCompany.Persons.Refresh
' pass-along the ObjectManager
Set CustomerDetailsDBGridNoDataControl.ObjectManager = _
ObjectManager
Set EventMessages.ObjectManager = _
ObjectManager
EventMessages.Show
CustomerDetailsDBGridNoDataControl.Show
Me.MousePointer = vbArrow
End Sub
Private Sub Command8_Click()
Me.MousePointer = vbArrowHourglass
publicCompany.Persons.Refresh
' pass-along the ObjectManager
Set CustomerDetailsListBoxNoDataControl.ObjectManager = _